package com.bdsy.system.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.bdsy.system.dao.UserRoleMapper;
import com.bdsy.system.model.UserRole;
import com.bdsy.system.service.UserRoleService;

/**
 * ClassName:UserServiceImpl
 * Description: TODO 添加描述.
 * @author   Administrator
 * @version  
 * @since    JDK 1.8
 */

@Service("userRoleService")
public class UserRoleServiceImpl implements UserRoleService{

    @Autowired
    UserRoleMapper userRoleMapper;
    
	@Override
	public List<Map> getRoleAuthCount() {
		List<Map> role = userRoleMapper.selectUserRole();
		return role;
	}
	
	@Override
	public boolean addUserRole(UserRole userRole){
		int result = userRoleMapper.insertUserRole(userRole);
		return result>0?true:false;
	}
	
	@Override
	public boolean updateUserRole(UserRole userRole){
		int result = userRoleMapper.updateUserRole(userRole);
		return result>0?true:false;
	}
	
	@Override
	public boolean deleteUserRoleById(List<String> pIds) {
		int result = userRoleMapper.deleteUserRole(pIds);
		return result>0?true:false;
	}
	
	@Override
	public void updateUserRoleByUserId(UserRole userRole) {
		userRoleMapper.updateUserRoleByUserId(userRole);
	}
	
	@Override
	public void deleteUserRoleByUserId(List<String> pIds) {
		userRoleMapper.deleteUserRoleByUserId(pIds);
	}
}

